{{ extend './baseTpl.art' }}

{{ block 'navbar' }}
<div id="navbar" class="collapse navbar-collapse">
    <ul class="nav navbar-nav">
        <li><a href="/">你好，Express！</a></li>
        <li><a href="/student">学生管理</a></li>
        <li class="active"><a href="/board">留言板</a></li>
    </ul>
</div>
{{ /block }}

{{ block 'main' }}
<div class="jumbotron">
    <h2>留言板</h2>
    <form action="/board" method="POST" class="form-horizontal" role="form">
        <div class="form-group">
            <label for="firstname" class="col-sm-2 control-label">你的姓名：</label>
            <div class="col-sm-10">
            <input type="text" class="form-control" name="name" placeholder="请输入名字">
            </div>
        </div>
        <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">留言信息：</label>
            <div class="col-sm-10">
            <textarea class="form-control" name="message" placeholder="请输入留言"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">提交留言</button>
            </div>
        </div>
    </form>
</div>
<div class="jumbotron">
    <h3>最新留言（{{ num }} 则）：</h3>
    <table class="table">
        {{ each db }}
        <tr>
            <td>{{ $value.name }} </td>
            <td>{{ $value.message }} </td>
            <td>{{ $value.time }}</td>
        </tr>
        {{ /each }}
    </table>
</div>
{{ /block }}
